#include <stdio.h>
#include <pthread.h>
#include <unistd.h>

void* threadrun(void* args)
{
  while(1)
  {
    printf("i'm %s, id is 0x%x\n", (char*)args, pthread_self());
    sleep(1);
  }
  return (void*)0;
}

int main()
{
  pthread_t tid;
  pthread_create(&tid, NULL, threadrun, (void*)"new thread");

  while(1)
  {
    printf("i'm main, new thread id is 0x%x\n", tid);
    sleep(1);
  }
  return 0;
}
